﻿using System.Collections.Generic;

namespace Prototype
{
    public class Manager
    {
        private Dictionary<string, IProduct> showcase;

        public Manager()
        {
            showcase = new Dictionary<string, IProduct>();
        }

        public void Register(string name, IProduct proto)
        {
            showcase.Add(name, proto);
        }

        public IProduct Create(string protoName)
        {
            IProduct p = showcase[protoName];
            return p.CreateClone();
        }
    }
}
